/**
 * @param {number[]} nums
 * @return {number}
 */
var findMin = function(nums) {
    let temp = nums[0]
    let l = 0, r = nums.length - 1
    while(l <= r) {
        let mid = (l + r) >> 1
        if(nums[mid] >= temp) {
            l = mid + 1
        } else {
            r = mid - 1
        }
    }
    if(l >= nums.length) return nums[0]
    else return nums[l]
};